package com.cskaoyan.factory;

import com.cskaoyan.bean.User;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * XXXFactoryBean生产的就是XXX
 * @author stone
 * @date 2022/06/16 15:42
 */
@Component
public class UserFactoryBean implements FactoryBean<User> {
    @Override
    public User getObject() throws Exception {
        User user = new User();
        user.setUsername("松哥");
        user.setPassword("远志");
        user.setAge(30);
        return user;
    }

    @Override
    public Class<?> getObjectType() {
        return User.class;
    }
}
